package ysother

import (
	"gitee.com/kmyss/gf-ex/yslog"
	"google.golang.org/grpc"
)

func ShowGRPCDes(desc grpc.ServiceDesc) {
	yslog.Print("----")
	yslog.Print("服务名:", desc.ServiceName)
	if len(desc.Methods) != 0 {
		yslog.Print("方法:")
		for _, method := range desc.Methods {
			yslog.Print("    - ", method.MethodName)
		}
	}
	if len(desc.Streams) != 0 {
		yslog.Print("流传输:")
		for _, stream := range desc.Streams {
			yslog.Print("    - ", stream.StreamName, "[服务端:", stream.ServerStreams, "][客户端:", stream.ClientStreams, "]")
		}
	}

	yslog.Print("----")
}
